/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author THIEN
 */
public class SetPriority extends Thread{
    String name[] = {"Meeting deadlines for the project",
    "Schedule variance for the project",
    "Effort variance for the project",
    };
    int Priorities[] ={1,2,7,8};
    public SetPriority() {
    }

    public void run()
    {
        //run 5 times
        for(int x = 0;x<1;x++)
        {
            int i,j;
            for(i=2,j=3; i>=0;i--,j--)
            {          
                System.out.println("In run() - Priority = "+Priorities[j]+" My name is: "+name[i]+" .\nAnd here are my Business Priorities.");
            
            }
            //pause for 1s
            try
                {
                    Thread.sleep(1000);
                }
            catch(Exception ex)
                {
                }
            System.out.println("I finish deadline 1. So set priority Meeting deadline to 1.");
            for(i=1,j=2; i>=0;i--,j--)
            {
                System.out.println("In run() - Priority = "+Priorities[j]+" My name is: "+name[i]+" .\nAnd here are my Business Priorities.");
            }
            System.out.println("In run() - Priority = "+Priorities[0]+" My name is: "+name[2]+" .\nAnd here are my Business Priorities.");
             //pause for 1s
            try
                {
                    Thread.sleep(1000);
                }
            catch(Exception ex)
                {
                }
            System.out.println("I finish effort. So terminate");
            System.out.println("In run() - Priority = "+Priorities[2]+" My name is: "+name[1]+" .\nAnd here are my Business Priorities.");
            System.out.println("In run() - Priority = "+Priorities[0]+" My name is: "+name[2]+" .\nAnd here are my Business Priorities.");
        }
    }
    public static void main(String Args[])
    {
        SetPriority SP = new SetPriority();
        SP.start();
         
    }
    
}
